#include <stdio.h>
#include "sum.h"
int sum(int a,int b)
{
    printf("a is %d\n",a);
    printf("b is %d\n",b); return a+b; }
struct test
{
    int a;
    int b;
    int (*p)(int,int);
};
int init(struct test *a)
{
   a->a=1;
   a->b=2;
   a->p = sum; return 0; }
int init_b(struct test *a, int (*p)(int a,int b))
{
   a->a=1;
   a->b=2;
   a->p = p;
   return 0;
}

int main()
{
    struct test a;
//    init(&a);
    init_b(&a, sum);
    printf("%d\n",a.a);
    printf("sum run %d\n",(*(a.p))(a.a,a.b));

}
